<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>vue过滤器</title>
</head>

<body>
    <div id="app">
        <h1>价格：{{price|fn('¥')}}</h1>
    </div>
</body>

</html>
<script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            price: 168
        },
        filters: {
            /* myInput：要处理的值，arg1：过滤器传递过来的参数符号 */
            fn: function (myInput, arg1) {
                var result = arg1 + myInput;
                return result;
            }
        }
    })
</script>